#ifndef LAYOUT_PANEL_H
#define LAYOUT_PANEL_H

#include "WidgetCreateDlg.h"

class LayoutPanel
{
public:
	LayoutPanel();
	~LayoutPanel();

	void Layout();
	MGUI_Layout * GetLayout() { return mLayout; }

	bool SaveLayout(const TString128 & filename);

protected:
	void OnCreate_();
	void OnDelete_();

	void OnWidgetCreate_(bool _ok);
	
	void OnWidgetSelChanged_(int _index);
	
	void OnNameChanged_(TString128 _name);
	
	void OnOpenLayout_(MGUI_Layout * layout);

protected:
	MGUI_Layout * mLayout;
	MGUI_ListBox * mListBox;

	WidgetCreateDlg * mWidgetCreateDlg;

	tListener0<LayoutPanel> OnCreate;
	tListener0<LayoutPanel> OnDelete;
	tListener1<LayoutPanel, bool> OnWidgetCreate;

	tListener1<LayoutPanel, int> OnWidgetSelChanged;

	tListener1<LayoutPanel, TString128> OnNameChanged;
	tListener1<LayoutPanel, MGUI_Layout *> OnOpenLayout;
};

#endif